﻿/*!
* jQuery TextChange Plugin
* http://www.zurb.com/playground/jquery-text-change-custom-event
*
* Copyright 2010, ZURB
* Released under the MIT License
*/
(function (a) {
    a.event.special.textchange = { setup: function () { a(this).data("lastValue", this.contentEditable === "true" ? a(this).html() : a(this).val()); a(this).bind("keyup.textchange", a.event.special.textchange.handler); a(this).bind("cut.textchange paste.textchange input.textchange", a.event.special.textchange.delayedHandler) }, teardown: function () { a(this).unbind(".textchange") }, handler: function () { a.event.special.textchange.triggerIfChanged(a(this)) }, delayedHandler: function () {
        var c = a(this); setTimeout(function () { a.event.special.textchange.triggerIfChanged(c) },
 25)
    }, triggerIfChanged: function (a) { var b = a[0].contentEditable === "true" ? a.html() : a.val(); b !== a.data("lastValue") && (a.trigger("textchange", [a.data("lastValue")]), a.data("lastValue", b)) } 
    }; a.event.special.hastext = { setup: function () { a(this).bind("textchange", a.event.special.hastext.handler) }, teardown: function () { a(this).unbind("textchange", a.event.special.hastext.handler) }, handler: function (c, b) { b === "" && b !== a(this).val() && a(this).trigger("hastext") } }; a.event.special.notext = { setup: function () {
        a(this).bind("textchange",
 a.event.special.notext.handler)
    }, teardown: function () { a(this).unbind("textchange", a.event.special.notext.handler) }, handler: function (c, b) { a(this).val() === "" && a(this).val() !== b && a(this).trigger("notext") } 
    }
})(jQuery);